﻿using System;
using System.Runtime.Serialization;

namespace Istace.Framework.Mapping.Core.Exceptions
{
    /// <summary>
    /// Exception thrown when the mapper service don't find appropriated mapper for type convertion
    /// </summary>
    [Serializable]
    public class MapperNotFoundException : MapperBaseException
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="MapperNotFoundException"/> class.
        /// </summary>
        public MapperNotFoundException()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="MapperNotFoundException"/> class.
        /// </summary>
        /// <param name="message">The message.</param>
        public MapperNotFoundException(string message) : base(message)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="MapperNotFoundException"/> class.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="exception">The exception.</param>
        public MapperNotFoundException(string message, Exception exception) : base(message, exception)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="MapperNotFoundException"/> class.
        /// </summary>
        /// <param name="info">The info.</param>
        /// <param name="context">The context.</param>
        protected MapperNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context)
        {
        }
        /// <summary>
        /// Default .ctor
        /// </summary>
        /// <param name="source">Type of the source object</param>
        /// <param name="destination">DestinationType mapping type</param>
        public MapperNotFoundException(Type source, Type destination)
            : base("Mapper not found.",
                    source,
                    destination)
        {
        }
    }
}
